package com.sunrise.xdoc.entity.employee;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;

import org.hibernate.annotations.Type;
import org.hibernate.validator.constraints.Length;
import org.joda.time.LocalTime;

import com.sunrise.xdoc.entity.AbstractAuditEntity;

@Entity
@Table(name = "emp_ca_lam_viec")
@Inheritance(strategy = InheritanceType.JOINED)
public class CaLamViec extends AbstractAuditEntity {
	private static final long serialVersionUID = -1980337300581609284L;
	private String name;
	private LocalTime startTime;
	private LocalTime endTime;

	@Column(name = "name", unique = true)
	@Length(max = 128)
	@NotNull
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@Column(name = "start_time", nullable = false)
	@Type(type = "org.jadira.usertype.dateandtime.joda.PersistentLocalTimeAsTimestamp")
	public LocalTime getStartTime() {
		return startTime;
	}

	public void setStartTime(LocalTime startTime) {
		this.startTime = startTime;
	}

	@Column(name = "end_time", nullable = false)
	@Type(type = "org.jadira.usertype.dateandtime.joda.PersistentLocalTimeAsTimestamp")
	public LocalTime getEndTime() {
		return endTime;
	}

	public void setEndTime(LocalTime endTime) {
		this.endTime = endTime;
	}
}
